<!-- $Id: listPosts.html 67 2011-03-26 13:06:51Z nicholasinlove1986@gmail.com $ -->
<include file="Public:pageheader"/>
<load href="__PUBLIC__/Js/domTT/domLib.js" />
<load href="__PUBLIC__/Js/domTT/fadomatic.js" />
<load href="__PUBLIC__/Js/domTT/domTT.js" />
<script type="text/javascript">
function sortBy(order,sort){
	location.href = "?order="+order+"&sort="+sort;
}
</script>

<div class="form-div">
  <form action="__URL__/listPosts" name="searchForm" >
    <img src="__PUBLIC__/Images/icon_search.gif" width="26" height="22" border="0" alt="search" />
    <select name="category_id" >
	<option value="0">{$Think.lang.all_category_id}</option>
	{$cat_option}
    </select>
	<select name="posts_author" >
	<option value="0">{$Think.lang.all_posts_author}</option>
	{$nick_name}
    </select>
    {$Think.lang.posts_title} <input type="text" name="keyword" id="keyword" />
    <input type="submit" value=" {$Think.lang.search} " class="button" />
  </form>
</div>

<form method="post" action="__URL__/batchPosts" name="listForm" onsubmit="return confirmSubmit_(this);">
  <div class="list-div" id="listDiv">
    <table cellpadding="3" cellspacing="1">
      <tbody>
        <tr>
          <th><input type="checkbox" id="chkOpenAll" onclick="openAll(this)" />
     <a href="javascript:void(0)" onclick="javascript:sortBy('posts_id','<if condition="$sort eq asc_posts_id">desc<else/>asc</if>');" title="{$Think.lang.sort}">{$Think.lang.numbers}</a>
            <if condition="$sort eq asc_posts_id"><img src="__PUBLIC__/Images/sort_asc.gif"/><else/><img src="__PUBLIC__/Images/sort_desc.gif"/></if></th>
          <th>{$Think.lang.list_posts_1}</th>
		  <th>{$Think.lang.list_posts_2}</th>
          <th>{$Think.lang.list_posts_3}</th>
          <th>{$Think.lang.list_posts_4}</th>  
		  <th>{$Think.lang.list_posts_5}</th>   
		  <th>{$Think.lang.list_posts_6}</th>    
 <th><a href="javascript:void(0)" onclick="javascript:sortBy('posts_stick','<if condition="$sort eq asc_posts_stick">desc<else/>asc</if>');" title="{$Think.lang.sort}">{$Think.lang.list_posts_7}</a>
            <if condition="$sort eq asc_posts_stick"><img src="__PUBLIC__/Images/sort_asc.gif"/><else/><img src="__PUBLIC__/Images/sort_desc.gif"/></if></th>
<th><a href="javascript:void(0)" onclick="javascript:sortBy('posts_allowcom','<if condition="$sort eq asc_posts_allowcom">desc<else/>asc</if>');" title="{$Think.lang.sort}">{$Think.lang.list_posts_8}</a>
            <if condition="$sort eq asc_posts_allowcom"><img src="__PUBLIC__/Images/sort_asc.gif"/><else/><img src="__PUBLIC__/Images/sort_desc.gif"/></if></th>
			<th><a href="javascript:void(0)" onclick="javascript:sortBy('posts_istrack','<if condition="$sort eq asc_posts_istrack">desc<else/>asc</if>');" title="{$Think.lang.sort}">{$Think.lang.list_posts_9}</a>
            <if condition="$sort eq asc_posts_istrack"><img src="__PUBLIC__/Images/sort_asc.gif"/><else/><img src="__PUBLIC__/Images/sort_desc.gif"/></if></th>
		  <th><a href="javascript:void(0)" onclick="javascript:sortBy('posts_draft','<if condition="$sort eq asc_posts_draft">desc<else/>asc</if>');" title="{$Think.lang.sort}">{$Think.lang.list_posts_10}</a>
            <if condition="$sort eq asc_posts_draft"><img src="__PUBLIC__/Images/sort_asc.gif"/><else/><img src="__PUBLIC__/Images/sort_desc.gif"/></if></th>
		  <th><a href="javascript:void(0)" onclick="javascript:sortBy('posts_hit','<if condition="$sort eq asc_posts_hit">desc<else/>asc</if>');" title="{$Think.lang.sort}">{$Think.lang.list_posts_11}</a>
            <if condition="$sort eq asc_posts_hit"><img src="__PUBLIC__/Images/sort_asc.gif"/><else/><img src="__PUBLIC__/Images/sort_desc.gif"/></if></th>
		  <th>{$Think.lang.list_posts_12}</th>
		  <th>{$Think.lang.list_posts_13}</th>
		  <th>{$Think.lang.list_posts_14}</th>
		  <th>{$Think.lang.handler}</th>
        </tr>
        <volist name="list" id="vo">
          <tr>
            <td style="background-color: rgb(255, 255, 255);" width="5%" class="first-cell"><input type="checkbox" id="key" name="key[]" onclick="openAll()" value="{$vo.posts_id}" />{$vo.posts_id}</td>
            <td style="background-color: rgb(255, 255, 255);" align="left" width="15%"><a href="#" onMouseOver="this.style.color = '#D17E62'; domTT_activate(this, event, 'content', '{$vo.posts_title}', 'trail', true, 'fade', 'both', 'fadeMax', 87, 'styleClass', 'niceTitle');" onMouseOut="this.style.color = ''; domTT_mouseout(this, event);">{$vo.posts_title|msubstr=0,8}</a></td>
            <td style="background-color: rgb(255, 255, 255);" align="left" width="7%"><span>{$vo.posts_author}</span></td>
			<td style="background-color: rgb(255, 255, 255);" align="center" width="4%"><span><a href="{&blog_domain}posts/{$vo.posts_url}/" onMouseOver="this.style.color = '#D17E62'; domTT_activate(this, event, 'content', '{$vo.posts_url}', 'trail', true, 'fade', 'both', 'fadeMax', 87, 'styleClass', 'niceTitle');" onMouseOut="this.style.color = ''; domTT_mouseout(this, event);" target="_blank">[+]</a></span></td>
            <td style="background-color: rgb(255, 255, 255);" align="left" width="7%" ><span>{$vo.category_title}</span></td>
			<td style="background-color: rgb(255, 255, 255);" align="center" width="4%"><span><a href="#" onMouseOver="this.style.color = '#D17E62'; domTT_activate(this, event, 'content', '<volist name="vo.tag" id="s">{$s.tag_name}&nbsp;&nbsp;&nbsp;</volist>', 'trail', true, 'fade', 'both', 'fadeMax', 87, 'styleClass', 'niceTitle');" onMouseOut="this.style.color = ''; domTT_mouseout(this, event);">[+]</a></span></td>
			<td style="background-color: rgb(255, 255, 255);" align="center" width="6%"><span>{$vo.posts_date}</span></td>
			<td style="background-color: rgb(255, 255, 255);" align="center" width="5%"><span><eq name='vo.posts_stick' value='1'><img src="__PUBLIC__/Images/yes.gif" border="0" height="14" width="14" alt="Yes"><else /><img src="__PUBLIC__/Images/no.gif" border="0" height="14" width="14" alt="No"></eq></span></td>
			<td style="background-color: rgb(255, 255, 255);" align="center" width="5%"><span><eq name='vo.posts_allowcom' value='1'><img src="__PUBLIC__/Images/yes.gif" border="0" height="14" width="14" alt="Yes"><else /><img src="__PUBLIC__/Images/no.gif" border="0" height="14" width="14" alt="No"></eq></span></td>
			<td style="background-color: rgb(255, 255, 255);" align="center" width="5%"><span><eq name='vo.posts_istrack' value='1'><img src="__PUBLIC__/Images/yes.gif" border="0" height="14" width="14" alt="Yes"><else /><img src="__PUBLIC__/Images/no.gif" border="0" height="14" width="14" alt="No"></eq></span></td>
			<td style="background-color: rgb(255, 255, 255);" align="center" width="5%"><span><eq name='vo.posts_draft' value='1'><img src="__PUBLIC__/Images/yes.gif" border="0" height="14" width="14" alt="{$Think.lang.posts_draft_1}"><else/><img src="__PUBLIC__/Images/no.gif" border="0" height="14" width="14" alt="{$Think.lang.posts_draft_2}"></eq></span></td>
			<td style="background-color: rgb(255, 255, 255);" align="center" width="5%"><span>{$vo.posts_hit}</span></td>
			<td style="background-color: rgb(255, 255, 255);" align="center" width="5%"><span><a href="__APP__/Comment/listComment/id/{$vo.posts_id}">{$vo.posts_comment}</a></span></td>
			<td style="background-color: rgb(255, 255, 255);" align="center" width="5%"><span><a href="__APP__/Trackback/listTrackback/id/{$vo.posts_id}">{$vo.posts_tracknum}</a></span></td>
            <td style="background-color: rgb(255, 255, 255);" align="center" width="12%"><span>{$vo.posts_addtime|date='Y-m-d H:i:s',###}</span></td> 
			<td align="center">
      <a href="__APP__/Posts/editPosts/id/{$vo.posts_id}"><img src="__PUBLIC__/Images/icon_edit.gif" border="0" width="16" height="16" alt="{$Think.lang.edit}"></a>&nbsp;&nbsp;
	  <a href="__APP__/Posts/trashPosts/id/{$vo.posts_id}" title="{$Think.lang.trash_}" onclick="return confirm('{$Think.lang.confirm}');" ><img src="__PUBLIC__/Images/icon_trash.gif" border="0" width="16" height="16"></a>
    </td>      
          </tr>
        </volist>
        <tr>
          <td colspan="2">
		<input type="hidden" name="select" value="do" />
		<select name="act" onchange="changeAction()">
        <option value="">{$Think.lang.please_select}</option>
		<option value="stick">{$Think.lang.list_posts_7}</option>
		<option value="unstick">{$Think.lang.list_posts_7_}</option>
        <option value="allowcom">{$Think.lang.list_posts_8_1}</option>
		<option value="unallowcom">{$Think.lang.list_posts_8_2}</option>
		<option value="istrack">{$Think.lang.list_posts_9_1}</option>
		<option value="unistrack">{$Think.lang.list_posts_9_2}</option>
        <option value="draft">{$Think.lang.posts_draft_1}</option>
		<option value="undraft">{$Think.lang.posts_draft_2}</option>
		<option value="trash">{$Think.lang.trash_}</option>
		</select>
		  <input type="submit" value=" {$Think.lang.submit} " id="btnSubmit" name="btnSubmit" class="button" disabled="true" /></td>
          <td style="background-color: rgb(255, 255, 255);" colspan="14" align="right" nowrap="true"><div class="{$pagestyle}" id="turn-page">{$page}</div></td>
        </tr>
      </tbody>
    </table>
  </div>
</form>
<script language="JavaScript">
function confirmSubmit_(frm, ext)
{
	if (frm.elements['act'].value == 'stick')
	{
	  
		return confirm("{$Think.lang.select_posts_1}");
	  
	}
	else if (frm.elements['act'].value == 'unstick')
	{
	  
		return confirm("{$Think.lang.select_posts_2}");
	  
	}
	else if (frm.elements['act'].value == 'allowcom')
	{
	  
		return confirm("{$Think.lang.select_posts_3}");
	  
	}
	else if (frm.elements['act'].value == 'unallowcom')
	{
	  
		return confirm("{$Think.lang.select_posts_4}");
	  
	}
	else if (frm.elements['act'].value == 'istrack')
	{
	  
		return confirm("{$Think.lang.select_posts_5}");
	  
	}
	else if (frm.elements['act'].value == 'unistrack')
	{
	  
		return confirm("{$Think.lang.select_posts_6}");
	  
	}
	else if (frm.elements['act'].value == 'draft')
	{
	  
		return confirm("{$Think.lang.select_posts_7}");
	  
	}
	else if (frm.elements['act'].value == 'undraft')
	{
	  
		return confirm("{$Think.lang.select_posts_8}");
	  
	}
	else if (frm.elements['act'].value == 'trash')
	{
	  
		return confirm("{$Think.lang.select_posts_9}");
	  
	}
	else if (frm.elements['act'].value == '')
	{
		return false;
	}
	else
	{
		return true;
	}
}

function changeAction()
{
	var frm = document.forms['listForm'];
	
	if (!document.getElementById('btnSubmit').disabled && confirmSubmit_(frm, false))
	{
		frm.submit();
	}
}
</script>
<include file="Public:pagefooter"/> 